<template>
	<view class="news_detail">
		<view class="title">{{news.newsTitle}}</view>
		<view class="info">
			<text>发布时间:{{news.newsTime}}</text>
			<text>点击次数:{{news.counts}}</text>
		</view>
		<view class="content">
			<rich-text>{{news.content}}</rich-text>
		</view>

	</view>
</template>

<script>
	import Bmob from '../../bmob/Bmob-2.2.4.min.js'
	export default {
		data() {
			return {
				news: "",
			}
		},
		methods: {
			getDetail(id) {
				const query = Bmob.Query('newsList');
				query.equalTo("objectId", "==", id)
				query.find().then(res => {
					console.log(res)
					this.news = res[0]
				});
			}
		},
		onLoad(options) {
			console.log(options);
			this.getDetail(options.objectId)
		}
	}
</script>

<style lang="scss">
	.news_detail {
		font-size: 30rpx;
		padding: 0 20rpx;

		.title {
			text-align: center;
			width: 710rpx;
			display: block;
			margin: 20rpx 0;
		}

		.info {
			display: flex;
			justify-content: space-between;

		}
		
		.content{
			margin-top: 20rpx;
			padding: 5rpx;
		}


	}
</style>
